package cn.itsource.controller;


import cn.itsource.domain.Permission;
import cn.itsource.dto.PermissionQuery;
import cn.itsource.service.IPermissionService;
import cn.itsource.ymcc.result.JSONResult;
import cn.itsource.ymcc.result.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//http://localhost:11000/ymcc/uaa/permission/pagelist
@RestController
@RequestMapping("permission")
public class PermissionController {

    @Autowired
    IPermissionService permissionService;



    /**
     * 接口注释模板
     * 1.请求方式:post
     * 2.请求url:pagelist
     * .请求参数:{a}
      4.返回参数:{PageList}
     */
    @PostMapping("pagelist")
    public JSONResult pagelist(@RequestBody PermissionQuery query){
        PageList<Permission> list =  permissionService.pagelist(query);
        return JSONResult.success(list);
    }


}
